{
  description = "nixos";
  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
    nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
    nixos-hardware.url = "github:NixOS/nixos-hardware/master";
    home-manager = {
      url = "github:nix-community/home-manager/release-24.11";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    nixvim = {
      url = "github:nix-community/nixvim";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    sops-nix = {
      url = "github:Mic92/sops-nix";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };
  outputs = inputs @ {
    self,
    nixpkgs,
    nixpkgs-unstable,
    home-manager,
    nixvim,
    sops-nix,
    nixos-hardware,
    ...
  }: let
    username = "humphrey";
    useremail = "dang8080@qq.com";
    editor = "nvim";
    extraArgs = inputs // {inherit username useremail editor;};
  in {
    nixosConfigurations = {
      nixos-surfacego = nixpkgs.lib.nixosSystem {
        system = "x86_64-linux";
        specialArgs = extraArgs; # will cause format error !!! // { inherit self inputs outputs };
        modules = [
          ./configuration.nix
          ./x86_64/hardware-configuration.nix
          home-manager.nixosModules.home-manager
          nixos-hardware.nixosModules.microsoft-surface-go
          {
            home-manager = {
              useGlobalPkgs = true;
              useUserPackages = true;
              extraSpecialArgs = extraArgs;
              backupFileExtension = "backup";
              users.${username}.imports = [
                ./hm.nix
                ./gnome.nix
              ];
            };
          }
        ];
      };
      nixos-utm = nixpkgs.lib.nixosSystem {
        system = "aarch64-linux";
        specialArgs = extraArgs; # will cause format error !!! // { inherit self inputs outputs };
        modules = [
          ./configuration.nix
          ./aarch64/hardware-configuration.nix
          home-manager.nixosModules.home-manager
          {
            home-manager = {
              useGlobalPkgs = true;
              useUserPackages = true;
              extraSpecialArgs = extraArgs;
              backupFileExtension = "backup";
              users.${username} = {
                lib,
                osConfig,
                ...
              }: {
                imports = [
                  ./hm.nix
                  ./gnome.nix
                ];
              };
            };
          }
          {
            nixpkgs.overlays = [
              (final: prev: {
                open-vm-tools = prev.open-vm-tools.overrideAttrs (old: {
                  postPatch =
                    old.postPatch
                    + ''
                      sed -i 's,/usr/bin/,/run/current-system/sw/bin/,g' services/plugins/vix/foundryToolsDaemon.c
                      sed -i 's,/usr/bin/,/run/current-system/sw/bin/,g' vmhgfs-fuse/config.c
                    '';
                });
              })
            ];
          }
        ];
      };
    };
  };
}
